


import 'package:reabampos/src/reabam/operation/bean/h5_upload_order.dart';
import 'package:reabampos/src/reabam/operation/bean/local_1/h5_bean_offline_order.dart';
import 'package:reabampos/src/reabam/operation/db/models.dart';
import 'package:reabampos/src/reabam/operation/db/objectbox.dart';
import 'package:reabampos/src/reabam/ui/support/support_upload_order_paylist.dart';
import 'package:reabampos/src/reabam/utils/rb_business.dart';
import 'package:shelf/shelf.dart';
import 'package:xsdk_flutter/xsdk/xsdk_flutter_package.dart';

/*
web server api通讯方式
 */
class WebServerRouter {
  SupportUploadOrderAndPay supportUploadOrderAndPay;

  WebServerRouter(this.supportUploadOrderAndPay);

  // Function getRouterHander_Setpcvalue(){
  //   return (Request request) async{
  //
  //     String requestBody=await request.readAsString();
  //     Map<String,dynamic> requestMap=XJsonUtils.json2Map(requestBody);
  //     String? sKey=requestMap['sKey'];
  //     dynamic sKeyData=requestMap['sKeyData'];
  //
  //     XLogUtils.printLog('---getRouterHander_Setpcvalue,sKey=$sKey,requestBody=$requestBody');
  //
  //     if('uploadOrder2'==sKey){
  //       //上传订单任务2.0
  //       XLogUtils.printLog('---getRouterHander_Setpcvalue,上传订单任务2.0');
  //
  //       Map<String,dynamic> result= supportUploadOrderAndPay.uploadOrderTask2(
  //           sKeyData,
  //           isWebServerApi:true,
  //       );
  //       XLogUtils.printLog('---getRouterHander_Setpcvalue,uploadOrder2,result=${XJsonUtils.obj2Json(result)}');
  //
  //       //通知队列重新执行api上传服务端线程
  //       if(!supportUploadOrderAndPay.isRunningUploadOrderTask2){
  //         supportUploadOrderAndPay.isRunningUploadOrderTask2=true;
  //         Future((){
  //           supportUploadOrderAndPay.listenerUploadOrderTask2();
  //         });
  //       }
  //
  //
  //       return Response.ok(XJsonUtils.obj2Json(result));
  //
  //     }else{
  //       return Response.ok(XResponseUtils.responseBodyJson(code: XResponseUtils.FailCode, message: '未定义sKey'));
  //     }
  //
  //   };
  // }

}